home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / f2c / may_5_92.lha / f2c.VMay_5_1992 / libI77 / rewind.c < prev    next >
C/C++ Source or Header  |  1992-05-07  |  350b  |  21 lines

  1. #include "f2c.h"
  2. #include "fio.h"
  3. integer f_rew(a) alist *a;
  4. {
  5.     unit *b;
  6.     if(a->aunit>=MXUNIT || a->aunit<0)
  7.         err(a->aerr,101,"rewind");
  8.     b = &units[a->aunit];
  9.     if(b->ufd == NULL || b->uwrt == 3)
  10.         return(0);
  11.     if(!b->useek)
  12.         err(a->aerr,106,"rewind")
  13.     if(b->uwrt) {
  14.         (void) t_runc(a);
  15.         b->uwrt = 3;
  16.         }
  17.     rewind(b->ufd);
  18.     b->uend=0;
  19.     return(0);
  20. }
  21.